<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
  <head>
    <title>在线音乐</title>
	<link href="CSS/style.css" rel="stylesheet"/>
<script language="javascript"> 
//控制复选框的全选或反选操作
function CheckAll(elementsA,elementsB){
	for(i=0;i<elementsA.length;i++){
		elementsA[i].checked = true;
	}
	if(elementsB.checked ==false){
		for(j=0;j<elementsA.length;j++){
			elementsA[j].checked = false;
		}
	}
}
//判断用户是否选择了要播放的歌曲，如果没有选择，则提示“请选择要播放的歌曲”；否则提交表单进行播放
function continuePlay(playId,formname){
	var flag = false;
	for(i=0;i<playId.length;i++){
		if(playId[i].checked){
			flag = true;
			break;
		}
	}
	if(!flag){
		alert("请选择要播放的记录！");
		return false;
	}else{
		formname.submit();
	}
}
</script> 


  </head>
  
  <body>

<div id="header">
  <div id="search">
  <form name="form_search" method="post" action="searchBy.do?action=search" style=" margin:0px;">
  搜索：<input type="text" name="key" id="key">
<input name="fieldName" type="radio" class="noborder" value="songName" checked>
  歌曲名
  &nbsp;
  <input name="fieldName" type="radio" class="noborder" value="specialName">
  专辑 &nbsp;
  <input name="fieldName" type="radio" class="noborder" value="singer">
  歌手&nbsp;
    <input name="songType_more" type="hidden" id="songType_more" value="4">
  <input name="Submit" type="submit" class="btn_bg" value="搜 索">
  </form>
</div>
</div>
<!--包含导航栏-->

<!-------------->
<div id="main" style="padding:0px; margin:0px; margin-bottom:5px;" class="tableBorder_blue">
<div id="title" style="height:30px; text-align:left; margin:0px; padding-bottom:0px; padding-left:10px; padding-top:10px; background-color:#E2F1EE;">
当前位置：${hint } &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.do" >首页</a>
</div>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="5px" bgcolor="#F97405"></td>
  </tr>
</table>

<form name="form1" method="post" action="continuePlay.do?action=continuePlay" target="_blank" style="padding-top:5px;">
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">
      <tr>
        <td align="center" bgcolor="#FFFFFF">选择</td>	  
        <td height="27" align="center" bgcolor="#FFFFFF">歌曲名称</td>
        <td align="center" bgcolor="#FFFFFF">演唱者</td>
        <td align="center" bgcolor="#FFFFFF">专辑名</td>
        <td align="center" bgcolor="#FFFFFF">文件大小</td>
        <td align="center" bgcolor="#FFFFFF">文件格式</td>
        <td align="center" bgcolor="#FFFFFF">下载次数</td>
        <td align="center" bgcolor="#FFFFFF">试听</td>
        <td align="center" bgcolor="#FFFFFF">下载</td>
      </tr>
	<c:forEach items="${pagelist.datas }" var="song" >
	
      <tr>
	    <td align="center" bgcolor="#FFFFFF">
	      <input type="checkbox" class="noborder" id="playId" name="playId" value="${song.id }" >
	    </td>
        <td height="27" bgcolor="#FFFFFF">&nbsp;
        ${song.songName }</td>
        <td bgcolor="#FFFFFF">&nbsp;
        ${song.singer}</td>
        <td bgcolor="#FFFFFF">&nbsp;
        ${song.specialName }</td>
        <td bgcolor="#FFFFFF">&nbsp;
        ${song.fileSize }M</td>
        <td bgcolor="#FFFFFF">&nbsp;
        ${song.format }</td>
        <td bgcolor="#FFFFFF">&nbsp;
        ${song.download }</td>
       <td align="center" bgcolor="#FFFFFF"><a href="#" onClick="window.open('trylisten.do?id=${song.id }','','width=500,height=360');">试听</a></td>
        <td align="center" bgcolor="#FFFFFF"><a  href="download.do?id=${song.id }">下载</a></td>
      </tr>
	</c:forEach>
     
	
  </table>
  <table width="100%"  border="0" cellspacing="0" cellpadding="0"> 
  <tr> 
	
	<td width="27%" style="padding-left:10px;color:#505050;"><input name="checkbox" type="checkbox" class="noborder" onClick="CheckAll(form1.playId,form1.checkbox)"> 
	  [<span class="word_green">全选/反选</span>] [<a style="color:FA6E00;cursor:hand;" onClick="continuePlay(form1.playId,form1)">歌曲连播</a>] 
	  <div id="ch" style="display:none"> 
		<input name="playId" type="checkbox" class="noborder" value="0"> 
	  </div></td> 
	<!--层ch用于放置隐藏的checkbox控件，因为当表单中只是一个checkbox控件时，应用javascript获得其length属性值为undefine-->
	<td width="73%" height="24"><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='24' align='right'>当前页数：[${pageNo }/${pagelist.pageNums }]&nbsp;<a href='SongerShow.do?singer=${singer }&pageNo=1'>首页&nbsp;</a><c:if test="${pageNo>1 }"> <a href='SongerShow.do?singer=${singer }&pageNo=${pageNo-1 }'>上一页</a></c:if><c:if test="${pageNo<pagelist.pageNums }"><a href='SongerShow.do?singer=${singer }&pageNo=${pageNo+1 }'>下一页</a></c:if>　<a href='SongerShow.do?singer=${singer }&pageNo=${pagelist.pageNums }'>最后一页&nbsp;</a></td> </tr>	</table></td> 
  </tr> 
</table>
  </form>
</div>

<div id="copyright">
<ul>
	<li> 流行金曲 | 经典老歌 | 欧美经典 | 校园民谣 | 联系我们 | 编程词典网 | 明日图书网 | 明日科技主站 </li>
	<li>技术服务热线：400-675-1066 传真：0431-84972266 企业邮箱：mingrisoft@mingrisoft.com</li>
	<li>
	公司地址：吉林省长春市亚泰广场C座  欢迎致电来函</li>
	<li>Copyright &copy; www.mrbccd.com All Rights Reserved! </li>
</ul>
</div>
  </body>
</html>
